home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5577 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: coke.engr.utk.edu!mbk
  2. From: mbk@I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN (Matthew B. Kennel)
  3. Newsgroups: comp.lang.misc,comp.lang.perl.misc,comp.lang.tcl,comp.lang.c,comp.lang.java
  4. Subject: Re: Readable Perl (was: Re: Relative Speed of Perl vs. Tcl vs. C)
  5. Followup-To: comp.lang.misc,comp.lang.perl.misc,comp.lang.tcl,comp.lang.c,comp.lang.java
  6. Date: 20 Feb 1996 00:12:09 GMT
  7. Organization: University of Tennessee, Knoxville
  8. Message-ID: <4gb3kp$lu7@gaia.ns.utk.edu>
  9. References: <4e3a2u$eoa@wcap.centerline.com> <4e54vc$7sk@orac.mon.rnb.com> <ukd97hwzkc.fsf_-_@linda.teleport.com>
  10. Reply-To: kennel@msr.epm.ornl.gov
  11. NNTP-Posting-Host: 128.169.100.253
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14. Randal L. Schwartz (merlyn@stonehenge.com) wrote:
  15. : >>>>> "John" == John Viega <jtv2j@mamba.cs.virginia.edu> writes:
  16.  
  17. : John> People bitch about the readability of Perl non-stop.  In fact, I have
  18. : John> heard the joke, "Perl, the only language you can uuencode, and not
  19. : John> notice" twice this week around the department.
  20.  
  21. : OK, now which do you find most readable...
  22.  
  23. :     $i = 1;
  24. :     while ($i <= 10) {
  25. :         print "I can count to $i\n";
  26. :         $i++;
  27. :     }
  28.  
  29. :     for ($i = 1; $i <= 10; $i++) {
  30. :         print "I can count to $i\n";
  31. :     }
  32.  
  33. :     foreach $i (1..10) {
  34. :         print "I can count to $i\n";
  35. :     }
  36.  
  37. :     $i = 0;
  38. :     print "I can count to $i\n" while ++$i <= 10;
  39.  
  40. :     print map "I can count to $_\n", 1..10;
  41.  
  42. :     50 FOR I = 1 TO 10
  43. :     60 PRINT "I CAN COUNT TO ",I
  44. :     70 NEXT I
  45.  
  46.  
  47. This one:
  48.  
  49. loop #OUT + "I can count to " + 1.upto!(10) + "\n"; end; 
  50.  
  51. Or, 
  52.  
  53. loop #OUT + "I can count anything: " + collection_class.elt!.str + "\n"; end;
  54.  
  55. Sather. 
  56.  
  57.  
  58. http://www.icsi.berkeley.edu/~sather. 
  59.